const { defineConfig } = require('@vue/cli-service')

const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
const port = process.env.port || process.env.npm_config_port || 80; // 端口
module.exports = defineConfig({

    publicPath: './',
    transpileDependencies: true,
    configureWebpack: {
        plugins: [
            AutoImport({
                resolvers: [ElementPlusResolver()],
            }),
            Components({
                resolvers: [ElementPlusResolver()],
            }),
        ]
    },
    devServer: {
        port: 8080,
        open: true,
        proxy: {
            '/lunaApi': {
                // http://183.238.157.204:8580/luna/assist/v1/training/lesson?limit=10&page=1
                // target: 'http://183.238.157.204:8280/luna/assist/v1/',
                target: 'http://183.238.157.204:10010/luna/assist/v1',
                // http://183.238.157.204:10010
                changeOrigin: true,
                pathRewrite: {
                    '^/lunaApi': '',

                },
            },
        },
    }
})

